#ifndef LANGUAGECONTROL_H
#define LANGUAGECONTROL_H

#include <QObject>
#include <QTranslator>
#include <QCoreApplication>
#include <QQmlEngine>
#include <QFile>
#include <QApplication>

class LanguageControl : public QObject
{
    Q_OBJECT

    // 当前语言类型
    Q_PROPERTY(int CurrentType READ CurrentType WRITE setCurrentType NOTIFY CurrentTypeChanged FINAL)

public:
    LanguageControl(QQmlEngine* engine);

    Q_INVOKABLE void load(int index);

    // Q_INVOKABLE void testBtn();

    int CurrentType() const;
    void setCurrentType(int newCurrentType);

signals:
    void CurrentTypeChanged();
private:
    int m_CurrentType;

    QTranslator* m_Translator;
    QQmlEngine* m_Engine;

};

#endif // LANGUAGECONTROL_H
